public class 找子串 {
    public static void main(String[] args) {
        boolean subsequence = isSubsequence("acb", "ahbgdc");
        System.out.println(subsequence);
    }
    public static boolean isSubsequence(String s, String t) {
        int sLeng=s.length();
        int tLen=t.length();
        int count=0;
        if(sLeng==0)
            return true;
        int j=0;
        for (int i = 0; i < tLen; i++) {
            if(t.charAt(i)==s.charAt(j)){
                j++;
                count++;
            }
            if(count==sLeng&&count!=0)
                return true;
        }
        return false;
    }
}